﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using WCYCReader.Base;

/**
 * 创建时间：2014/11/19 22:22:12
 * 作者：yong.blackcore
 * Email：itblackhole@outlook.com
 * QQ：50404503
 */
namespace WCYCReader.Models
{
    [DataContract]
    public class ComputeAddressModel1 : INotifyPropertyChanged
    {
        [DataMember]
        public string Name { get; set; }


        private string _ip;

        /// <summary>
        /// //Ip
        /// </summary>
        [DataMember]
        public string Ip
        {
            get { return _ip; }
            set { _ip = value; }
        }

        private string loginName;

        [DataMember]
        public string LoginName
        {
            get
            {
                return this.loginName;
            }
            set
            {
                if (value != this.loginName)
                {
                    this.loginName = value;
                    this.NotifyPropertyChanged("LoginName");
                }
            }
        }

        [DataMember]
        public string LoginPwd { get; set; }

        [DataMember]
        public string ShareFolder { get; set; }

        private string _shareFolderPath;

        /// <summary>
        /// <para>Ip/ShareFolder</para>
        /// </summary>
        [DataMember]
        public string ShareFolderPath
        {
            get { return string.Concat("\\\\",this.Ip, "\\", this.ShareFolder); }
            set { _shareFolderPath = value; }
        }

        private void NotifyPropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler propertyChangedEventHandler = this.PropertyChanged;
            if (propertyChangedEventHandler != null)
            {
                propertyChangedEventHandler(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;
    }
}
